import Https from '@/utils/https'

// 获取指标目录(后端没有做树形结构封装)
const listCatalog = (params) => Https.get('/api/v1/index/listCatalog', params)
// 新增指标目录
const addCatalog = (params) => Https.post('/api/v1/index/addCatalog', params, { json: false })
// 编辑指标目录(仅支持修改名字)
const editCatalog = (params) => Https.post('/api/v1/index/editCatalog', params, { json: false })
// 删除指标目录(有子目录不能删除)
const delCatalog = (params) => Https.post('/api/v1/index/delCatalog', params, { json: false })
// 获取所有部门(数据owner)
const getDepartList = (params) => Https.get('/api/v1/index/getDepartList', params)
// 新建或编辑指标
const saveIndex = (params) => Https.post('/api/v1/index/saveIndex', params)
// 新增指标版本
const addIndexVersion = (params) => Https.post('/api/v1/index/addIndexVersion', params)
// 删除指标
const delIndex = (params) => Https.get('/api/v1/index/delIndex', params)

export {
  listCatalog, addCatalog, editCatalog, delCatalog, getDepartList, saveIndex, addIndexVersion, delIndex,
}
